L2D.Interface.setitem = function(id, count) {
	alert(`得到物品${id},数量${count}个。`);
}

L2D.Interface.getDialogPosition = function(talker) {
	// 寻找talker坐标
	var sprite;
	for(var i = 0; i < scene.children.length; i++)
		if(scene.children[i].name == talker) 
			sprite = scene.children[i];
			
	// 如果未找到对话者则跳过
	if(!sprite) 
		return {x:0,y:0};
	
	const frameX = (sprite.x - camera.pivot.x) * camera.scale.x + camera.x - 168;
	const frameY = (sprite.y - camera.pivot.y) * camera.scale.y + camera.y - 133;
	return {x:frameX,y:frameY};
}

L2D.Interface.showImage = function(url, x, y) {
	var texture = PIXI.Texture.from(url);
	const bunny = new PIXI.Sprite(texture);
	bunny.x = x;
	bunny.y = y;
	L2D.UserInterface.addChild(bunny);
	return bunny;
}

L2D.Interface.hideImage = function(image) {
	L2D.UserInterface.removeChild(image);
}